/*
 * Copyright (C) 2016  Nicola Spanti (RyDroid) <dev@nicola-spanti.info>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */


#ifndef PLANET_WARS_2D_RT_CORE_MODEL_GAME_STATE_H
#define PLANET_WARS_2D_RT_CORE_MODEL_GAME_STATE_H


#include "PlanetWars2dRT-core/specific/model/game_state_basic.h"
#include "PlanetWars2dRT-core/specific/model/game_state_selection.h"


EXTERN_C_BEGIN


struct game_state_t
{
  struct game_state_basic_t     basic;
  struct game_state_selection_t selection;
};
typedef struct game_state_t game_state_t;


void
game_state_destructor(game_state_t* a_state);

void
game_state_init_first_time_only(game_state_t* a_state);


bool
game_state_is_in_pause(game_state_t* a_state);

void
game_state_set_pause(game_state_t* a_state, bool value);

void
game_state_toogle_pause(game_state_t* a_state);


unsigned short
game_state_get_update_speed(game_state_t* a_state);

bool
game_state_reduce_update_speed(game_state_t* a_state,
			       unsigned short reduction);

bool
game_state_decrement_update_speed(game_state_t* a_state);

bool
game_state_increment_update_speed(game_state_t* a_state);


bool
game_state_has_to_quit(game_state_t* a_state);

void
game_state_set_quit(game_state_t* a_state, bool value);


enum selection_state
game_state_get_selection_state(game_state_t* a_state);

enum selection_2d_type
game_state_get_selection_type(game_state_t* a_state);


void
game_state_clear_selection(game_state_t* a_state);

void
game_state_starts_rectangle_selection(game_state_t* a_state,
				      unsigned int x,
				      unsigned int y);

void
game_state_moves_rectangle_selection(game_state_t* a_state,
				     unsigned int x,
				     unsigned int y);

void
game_state_ends_rectangle_selection(game_state_t* a_state,
				    unsigned int x,
				    unsigned int y);

void
game_state_move_selected_ships(game_state_t* a_state,
			       unsigned int x,
			       unsigned int y);


EXTERN_C_END


#endif
